package leetcode.editor.cn;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: yangwk
 * @date: 2023/2/7
 * @description:
 **/
public class P1987NumberOfUniqueGoodSubsequences {
    static List<String> result = new ArrayList<>();

    public static int numberOfUniqueGoodSubsequences(String binary) {
        uniqueGoodSubsequences(binary);
        return result.size();
    }

    private static void uniqueGoodSubsequences(String binary) {
        int length = binary.length();
        for (int i = 0; i < length; i++) {
            for (int j = i + 1; j <= length; j++) {
                String substring = binary.substring(i, j);
                if (!substring.startsWith("0") || "0".equals(substring)) {
                    if (!result.contains(substring)) {
                        result.add(substring);
                    }

                }
            }
        }
    }

    public static void main(String[] args) {
        System.out.println(numberOfUniqueGoodSubsequences("11"));
    }

}
